@import 'sass/variables';

.example-form {
  max-width: 744px;
  margin: auto;
}

.input-group {
  margin: auto;
  display: flex;
  flex-direction: column;

  > .TogglablePassword {
    width: 100%;
  }

  & > pre,
  & > .Select,
  &-input {
    margin-bottom: 1rem;
  }

  &-inline {
    display: flex;
    flex-direction: row;
    font-size: 1rem;
    flex-wrap: wrap;

    > .input-group-header {
      width: 100%;
    }

    > .input-group-input {
      flex-grow: 1;
      width: auto;
    }

    > .Select {
      margin-left: 8px;
    }

    &[readonly],
    &[disabled] {
      background-color: color(control-disabled-bg);
      color: color(control-disabled-color);
      border-color: color(control-disabled-border);
      cursor: text !important;
    }
  }

  &-header {
    display: flex;
    font-size: 1rem;
    margin-bottom: 8px;
    font-weight: 400;
    align-items: center;
    flex-wrap: wrap;

    > *:first-child {
      margin-right: 8px;
    }

    > .flex-spacer {
      flex-grow: 1;
    }

    > .small {
      color: color("gray");
    }
  }

  &-input {
    width: 100%;
    border: 1px solid color(control-border);
    border-radius: $input-border-radius;
    height: $input-height-base;
    padding: 0.75rem 1rem;
    font-weight: 400;
    background: color(control-bg);
    color: color(control-color);
    box-shadow: inset 0 1px 0 0 rgba(63, 63, 68, 0.05);
    transition: border-color 120ms, box-shadow 120ms;
    margin-bottom: 1rem;

    @media (max-width: 700px) {
      margin-bottom: 0em;
    }

    &[placeholder] {
      text-overflow: ellipsis;
    }

    &.border-rad-right-0 {
      border-top-right-radius: 0;
      border-bottom-right-radius: 0;
    }
    &.border-rad-left-0 {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }
    &-small {
      padding: 0.5rem 0.75rem;
    }
    &::placeholder {
      color: color(control-placeholder);
    }
    &:not([disabled]):not([readonly]) {
      &.invalid {
        border-color: color(brand-danger);
        box-shadow: inset 0px 0px 0px 1px color(brand-danger);
      }
      &.valid {
        border-color: color(brand-success);
        box-shadow: inset 0px 0px 0px 1px color(brand-success);
      }
      &:focus {
        border-color: color(brand-primary);
        box-shadow: inset 0px 0px 0px 1px color(brand-primary);
      }
    }
  }
}

.Swap-dropdown {
  .Select-input {
    left: 24px;
  }
}

textarea.input-group-input {
  height: initial;
}
